import pyecharts.options as opts
from pyecharts.charts import Line
from pyecharts.faker import Faker

c = (
    Line()
    .add_xaxis([
    "00:00:00",
    "01:00:00",
    "02:00:00",
    "03:00:00",
    "04:00:00",
    "05:00:00",
    "06:00:00",
    "07:00:00",
    "08:00:00",
    "09:00:00",
    "10:00:00",
    "11:00:00",
    "12:00:00",
    "13:00:00",
    "14:00:00",
    "15:00:00",
    "16:00:00",
    "17:00:00",
    "18:00:00",
    "19:00:00",
    "20:00:00",
    "21:00:00",
    "22:00:00",
    "23:00:00",
    "24:00:00",
])
    .add_yaxis(
        "商家A",
        [
            300,
            280,
            250,
            260,
            270,
            300,
            550,
            500,
            400,
            390,
            380,
            390,
            400,
            500,
            600,
            750,
            800,
            700,
            600,
            400,
            300,
            280,
            250,
            260,
            260,
        ],
        markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
    )
    .add_yaxis(
        "商家B",
        [
            1300,
            1280,
            1250,
            1260,
            1270,
            1300,
            1550,
            1500,
            1400,
            1390,
            1380,
            1390,
            1400,
            1500,
            1600,
            1750,
            1800,
            1700,
            1600,
            1400,
            1300,
            1280,
            1250,
            1260,
            1270,
        ],
        markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
    )
    .set_global_opts(title_opts=opts.TitleOpts(title="Line-MarkLine"))
    .render("line_markline.html")
)
